package com.aaa.entity;

import javax.persistence.*;
import java.util.Objects;

/**
 * fileName:ScoreEntity
 * description:
 * author:王宇航
 * createTime:2019/10/12 14:14
 * version:1.0.0
 */
@Entity
@Table(name = "score", schema = "trainingdb", catalog = "")
public class ScoreEntity {
    private int id;
    private int stuid;
    private int examId;
    private Integer scoce;
    private Integer classId;
    private String stuName;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "stuid")
    public int getStuid() {
        return stuid;
    }

    public void setStuid(int stuid) {
        this.stuid = stuid;
    }

    @Basic
    @Column(name = "exam_id")
    public int getExamId() {
        return examId;
    }

    public void setExamId(int examId) {
        this.examId = examId;
    }

    @Basic
    @Column(name = "scoce")
    public Integer getScoce() {
        return scoce;
    }

    public void setScoce(Integer scoce) {
        this.scoce = scoce;
    }

    @Basic
    @Column(name = "class_id")
    public Integer getClassId() {
        return classId;
    }

    public void setClassId(Integer classId) {
        this.classId = classId;
    }

    @Basic
    @Column(name = "stu_name")
    public String getStuName() {
        return stuName;
    }

    public void setStuName(String stuName) {
        this.stuName = stuName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ScoreEntity that = (ScoreEntity) o;
        return id == that.id &&
                stuid == that.stuid &&
                examId == that.examId &&
                Objects.equals(scoce, that.scoce) &&
                Objects.equals(classId, that.classId) &&
                Objects.equals(stuName, that.stuName);
    }


    public ScoreEntity(int stuid, int examId, Integer scoce, Integer classId, String stuName) {
        this.stuid = stuid;
        this.examId = examId;
        this.scoce = scoce;
        this.classId = classId;
        this.stuName = stuName;
    }

    public ScoreEntity() {

    }

    @Override
    public int hashCode() {
        return Objects.hash(id, stuid, examId, scoce, classId, stuName);
    }
}
